moved setup code from plugin to facet and some refractor