Try to fix MAV
Refactor main.cb part one.