Moved listing of profiles closer to beginning to avoid superfluous processing.