Final refactoring of packages

Final refactoring of packages