working with contexts optimized (local function element)