Improve Db gateway process