Experiments with type hints and tiny refactoring.