Changed package output name.
Refactored duplicate code.