Minor adjustments made on lines
Removed unneeded lines of code as they are now used on the template custom filter