move SQL queries to job model
move SQL queries to models