Simplify getting extents into JS