Add syntax sugar for array define and improve enter/leave sequence