Improve efficiency and network error handling
Refactor logic out of Package