Brought in latest refactorings