refactoring code, embed widget into sample site