More code cleaning, plus preliminary look at search functionality (not enabled yet)