[NDCPortable] code tidy up