Further refactoring, organised code under a start function