Refactored packages and fixed link building error