move public method to top of class
test fix: specified case was impossible
extract utility methods