Refactored messaging to work with arrays.