Improve SQL layout