[Refactor] Refactored so that there will be two places where need check sort type. One in utility.js, the other is in HomeController.cs