Move code to free memory into Deployer