Refacoring styleCheckbox function.