Refactor code to more natively support categories and commands