refactoring with correct templates substitution