Stratum library rewrite