Refactor and comment better
Add polyfills