improved use of envelope srid
cleanup