add placeholder attribute polyfill, cleanup code