refactor

use more continuation-style stuff instead of exception stuff