Removed some logic from templates