Optimized code for reverse address ruby app.