Refactor profiles. 
Half of certificate processing done.