Further cleanup of refactoring