reformat code a bit