cleans up code a bit