Changed Database class structure