split some stuff into common.rs