Refactoring and package arranging