Refactor to use OpenTrails library.