add Pet object and move pets code there