new database & config. need refactoring