Improve JRuby interop implementation