Some refactors of ObjectUtils.