more refactoring and some mustard fixes