refactoring rest/package.py view