Categories refactor