Added private middleware.

Fixed extended component
Removed replace component feature because it breaks encapsulation.