removing logic from templates, reducing the complexity of template tags