Reformat the code to be split up into separate categories