some performance imporvements