I've removed the callable typehints which should make this code 5.3 compatible.