refactor Tamagotchi creation function