start to clean up the code