Refine env structure