fix type hints and use correct methods