Logic change

Separated template loading logic to allow load_template to be called
externally if needed