small refactor and version bump to 0.2.2