pet class and database handler