mathematica and refactor ruby