simplify ruby script