Refactoring Category Controller & Search Controller