Replaced method with template