fix issue with request misuse

Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>
move mathematical operations at better places

Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>
simplify message code

Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>