Improve SQL, Removed CB as dependency, Removed unnecessary, Formatting