returning text if no code block, and breaking out message parsing into method