[Ticket #24] Context management implementation