file message state
src/lib.rs refactor suggested
