replace native implementation with ruby implementation