Code refactoring with specific packages