refactor java backend to use more dependency injection

**please review**
make a TODO item which contains your explanation above?