Code cleanup, making the receive method clearer.