Code Refactor

refactor button disable and enable code