bugfix + cleanup