Updated SQL queries. Refactoring.