refactoring toggleColumns for extrenal rendering