Refactored Adoption class and implemented a class method.