refactoring button animation