refactoring array and remove handler

enterHandler and exitHandler is enough