Refactor of categories, part I.