move Message definition to types