Start refactoring cppia code