Upgrading preserve_resources method to work with 0.19.1 and also simplifying it.