Search splitted to TUI and library code