re-organizing modal-window relationship