Reduce complexity

refinement/refactoring of initial approach
 - [x] extracted/refined methods and field names
 - [x] added javadoc
 - [x] added unit tests
 - [x] update for more intuitive algorithm
 - [x] removed unnecessary code