refactoring Ndef code to a separate class