Switched things to function call instead of templates