Added sql configuration
Refactoring