Fix apparently code to get current metadata code is duplicated and was not fixed everywhere
Added todo