refactored db_handler.py into a class