Reduced code duplication in Utility.java