Extract template to it's own class