refactor animal constructor