Don't return a stack variable

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Don't use the same variable for new and old profile

This will make no difference when we remove the old profile, but for now I
worry that this could cause us trouble.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Code cleanup

We called the helper functions way too often.
Whitespace / coding style adjustments.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>