Major refactoring for Curacao 2.0-RC1