Abstracted a bunch of deferred code