fixed style problems and removed redundant code in categories search