refactor: improve code for category selecttion implementation.