categories refactor