cleanup the ruby code