Refactor Deferred class