refactoring checkbox class