Refactor workspaceId handling in DeviceServiceImpl and UserOrgServiceImpl to improve null checks and reduce redundancy