Refactor and bump version