Cleaning up and optimizing.