refactored Database lib file to use the configuration file