checkpoint

initial refactoring from internal proof-of-concept