Improve parsing of profiles