refactor and put classes in their proper package