Refactor global variable in class Messages, change from global to local