split out debug functions in runtime