Removed duplicate workspace change call and refactored the workspace visibility method