move template dir into config
remove commented out previous code
make interface more conventional
add docstring