refactor and close sql leaks