move get template into method