task #1734: refactoring replace global function to context processor.