Restructuring Scarlet implementation.