rebased on plain version
updated deps
refactored library