Move FRAM logic into distinct module.