improved ruby compatibility