Move group detection to mongo model