refactor code with new columns class