[samjsharpe] reorganise for maintainability