more refactor plus recording is working again