simplified ruby snippets