Cleanups + reworked search function a little