reorganized packages, some refactoring