initial commit
some refactoring