cleans up the code a bit