refactored original code to use com.saphir2 packaging; updated to jdk8 (small refactors might be applied in future commits to use more recent/faster approaches)