Refactoring to accept widgets, adding widgets. Unstable implementation, subject to race conditions.