each extension code are wrapped in code block. helper functions added to serviceExtension.