optimizing some and placing safeguards