Cleaned up target context management.