refactor to make use of proper parts of the runtime
Removed unused imports.