Moved queries to models