Improving Ruby snippets