added package file and refactored url generation code