removed more unused packages and changed file pkg to use a type storing db and index instead of functions