Add more type hints for performance