Text this: Optimization of core-valence states of molecules