Added pad z-indexing to fix bug, refactored message actions to simply and remove code duplication.