Win_detach uninteresting part of the code