Restructuring to use deferred callbacks, reorganizing classes to allow greater flexibility.