cache the result of factor