done some refactoring
misc
updated version