changed views to work with models and db