refactoring code of four columns