refactory and setting reset button method