Code refactorization and big merge speed-up.