Merge updates from the refactor branch