Refactor to simplify how widgets/actions are created