Refactored DbManager