button refactoring