refactor error handling
fmt
use a channel to coordinate updates