Rebased version of #54 (closed checks)

- Rebased #54 on latest master
- Code review fix

@rsrsps @eapache