Refactoring the core packages