Abstract the SELECT statement
Add dependencies for db modules
Check password query