Moving Delay outside of IF