Starting to split out the model to make the code more readable