Added everything to context based function generation (compartmentalized).