Increased template modularlity a bit.. basically template refactoring