refactor models & routing