db queried moved to models