Encapsulated some of the calculations