reformat code a little for readability