applying same changes as in bars branch with foos to master