nfc functions refactored