Added a dynamic extend method.