refacto + message type to plugins