Refactoring of the widgets visibility methods.