NXP-14598: simplify writer implementation, fixing lookup of method depending on resource type