Refactoring/Bugfixing