moved messages to separate functions