update version and some refactoring