refactors code to use less templates