Refactoring DB Class.