Move the detach call to a private header file instead.