refactored polyfill

Signed-off-by: Rik Cabanier <cabanier@adobe.com>