Refactoring ServiceUtils.java class