Bugfix & Refactor