Refactor dialog base class into its own module for easier re-use