refactor checkbox