CDB-4165 removal of no longer needed variable, better load and detection of layer ids