large refactor of model architecture (see notes)