add function to translate tokens in legacy config
refine bam_config parsing