Refactoring

+ some of Tomas comments have been addressed
+ new Apache River dependency changed.