Adding some structure to the code