only call the cb when everything has been consumed
move resetting the state into its own method
externalize error handling
v0.3.2