Code cleanup (let -> when-let, remove unnecessary conditionals)