refactoring template crap...still