Further cleanup and optimizations of widgets