clean up code a bit