removed if-let/when-let, added type hints