Refactoring ServiceUtils.java