refactor webcomponent