Refactor promises
refactor deferred
refactor chunk read/write