Java refactor connections service

Java refactor connections service