first draft
architecture + fixes
code organization