Some troubleshooting code for profile finder
Refactor code to avoid having to reindent