Major cleanup + setting impl.