removed db logic from view