restructed a bit