use map shorthand
remove unused search entities
remove obsolete before_create block
simplify get_root_categories