inherited templates refactor