Refactor entity pkgs