clean up code a little