Some refactoring and a temporary fix to keep dust consistent