refactoring readButton