lists:keytake might be tidier.