Refactor profile parsing.
Refactor profile parsing.