Updated ruby version, cleaned up code