Avoid using hard-coded sleep statements and replace them with smart