Refactor to use templateAdapter.(getTemplate|getLayout)