factored out models
modified route handling