printMessage is split into two functions.