modularize config and database