cut down on code repetition, reformat code