[PATCH 1/2] dmime: Move finding a track to a help function