config.sql refactor