moving language track logic in to a separate file