refactoring and missingColumns method