Finish refactoring for horizon merge.