making delegate script less brittle