deleted a few unnecessary imports
large refactor, may or may not work, not tested!