General refactor of current classes and upgrade of dialog support