refactor profiles into directive