improve the response of workspace change
refactoring