Refactors initDisplayDelay function for readability