more cleanup, and use chain
progress on #51

things looking pretty good