NXP-14948: cleanup and format
NXP-14948: avoid NPE