Refactored database write action in WorkspaceTagController