Template magic -> code cleanup!