Code cleanup, search edit