spliting base.js code to base widgets