code cleanup and multi prompt dialog listening for the return key.