refactoring radio button