STS-3646: Refactoring. Use extensions for common functions.