Moved enter-key event out of main