Refactoring and beginning of H2 integration