Adding implementation comments and removing exit_context (not used anymore)