Cleanup widget classes code duplication