this is a little evil at this point (with model in another file), but I can clean it up later. refactoring model into its own module as part of this big unrelated commit is already sketchy so more cleanup can wait