edit categories refactoring