refactor expand to use expand_variables

This just make it obvious in what order expansion is working.