basic refactoring to initialise some objects in valid state