adding animation and avoiding DRY