refactorings for a more template like basic structure