factor out the show trail code