even better templates refactoring