refactor java backend to use more dependency injection

**please review**
rename this class