refactored - Entity holds objects instead of ids, Categories can have at least one parent
small refactoring