Correcting template model and test refactoring