Refactored data extraction, layer rasterization and output