improve sql setup