ignore vim files
improve queries to database

use where clauses instead of looping into the results