correct RFX utility to properly handle EOL (new line)
use const qualifier when appropriate