moved search functions to a separate controller plus small improvements and debug options