Improve SQL queries
Better coding style