initial package
some refactoring