remove a few usages of JDK internal API