PIM-1597 Cleanup when possible to reduce changes whith master