move logic to auto-manager.