refactoring button