add hal context and env privder