Complex refactorization