Splits out code to make it more modular