clean up code further