templates sorting for ajax replaced with simpler fitering