BG class better, fixed some logic in mainview