simplify build_message logic