we can probably move a bunch of this stuff into a base controller class to avoid having it duplicated all over the place