cleaning up code a little