Refactor NSObject helpers to eliminate duplication