Extract sleep() into separate method.