test flipper
refactoring and cleaning