some fixes and refactoring
fix widget's reset()