refactor models to make code clearer