custom macro delay
refactoring