RTC: @TomMalbran -- refactor code for reuse