Revert "Revert "Factorize""

This reverts commit 7d3b652d27fce33891122690eb2737aae78b0a1c.
Revert "Factorize"

This reverts commit 0d80fbc45bb9a523e650f3f473875aafa16ce940.