Code refactoring

I've found your example here http://www.slideshare.net/anisniit/jruby-15867973 and found it pretty usefull for me. Hope my little code refactoring will be usefull for you.