refactoring to start generalisation