Split functionality out into multiple seperate files to aid maintainabilty