Gem/DB configuration refactoring