some refactoring
some refactoring in flying_rows. remained: frontend logic, foreign_key problem