Some refactoring for recent years changes

Would be nice if you can publish the gem to rubygems