some refactoring
tests update