Support switch environment

ref #33