remove redundant code in ResourceUtil