Add type hints to improve the performance