Improve workspaces handling