Refactor structure to form package