Reduced unnessasary SQL queries.