More refactoring for 171