Cleaned up search function on index