Adding a new buildProfile functionality and associated tests.