optimizing & cleaning up