Refactor, add docs and bump version