refactor extend ruby