Refactor main login into writeCard.
Fix bug, missing content in text node.