moved view code out of widgets service