Refactoring animal.c