Formatted messages when there is a username
Cleaned up code and put things into neat functions