Some little refacto and set SQLLogger to null to avoid memory leaks