clean up the code a lot