improved modal, cleanup a bit