Refactoring again ..

Refactoring, Cleanup, Bugfixing.