NFC refactoring

Change-Id: I5428252cb2c418fddf47267b4999b75808b44e96
Merge "NFC refactoring" into cm-10.1