Refactor to use common StringUtils.