just some refactoring for get it better testable
added new tests