prettified the code a bit