Improve ruby snippets