Re-enable profile deletion and renaming features

Re-enable profile deletion and renaming features as they seem to work fine - I couldn't find a test that broke them.

Also, refactored to make it easier to read a bit & got rid of a function we don't need anymore.