core refactor, and widgets module