Second refactoring to change checkbox and radio rendering feature