Fixed dimerror
Removed unused imports
Added runtime package
Removed code duplication