extracted and improved traversal of derivates