clean up space and code