Put templates into a class

Signed-off-by: Michael Buesch <m@bues.ch>