refactor messageboxes