Added SQL query generators
Simplified queries
Minor corrections
Removed unnecessary code