remove useless factory. Use provider.
add security context option