refactoring flashcard submit