some cleanups
require emf