extract code before the folder changes