removed many of the syncronized blocks to improve performance