refactored to remove EM_APP to appContext: readability