refactor example code with usage of NSNumber mapping