Automatically redirect to a record if we are doing an id search
Remove unused code
Cleanup code so it validates better in IDE