refactoring define flipType
refactoring remove unnecessary sentence