Remove complex and duplicated condition on assigning underlineStyle