Completely crazy bug hunt

Moved lot's of code around to fix import issues. Should be good for now.

Signed-off-by: Christoph Kassen <c.kassen@telekom.de>