make java a more loosely coupled dependency