final code clean up for XE17 version