refactoring rank radio buttons