Refactored packages to contain named constructor function