Adding Profile Provider support.

Refactoring similar logic shared between providers.