refactoring and delay tests