moving more sql queries to models
using models in controller