Additional fixes to refactor