Merge "RTP refactor and optimization." into main