Code factorization between as7 and wf8