Code refactoring; add exec environment context