refactor category