lib.rs: added; refactored