cleanup and rubification of jruby code