clean up code and test