Add logging output
Extract method
Make method generic
Use element truncation method to truncate pwmotiontexts too