Refactored DriverScript and StafReferences to reduce the size of the code