Simplify: get rid of unnecessary as.raster object