Add some type hints for performance.