made janus_max_template_size a function