lib: use .clone() where possible