mainview now uses an enum to swich mode instead of integer