make the repositories configurable; optimize building data function;optimize search function