Use global instead of refs