mg: base controller implementation