moved search options to config file, cleaned up code