removed Flag class and unused stuff