Changing to use Jinja logic