small changes
some refactoring