Duplicate code reduction and standardization in category views and hit counting