Set the state from configs. Some renames and clean-up.