refactor button