CON-1233 clean up the code