Partially factor in code from Tensile.