clean up code a little bit