functions love names :)

reformat code: give names to functions, reverse functions order to
improve readability