some refactoring, README slightly updated