refactor button state for faster button stating