clean code to access methods in template