remove unused functions, add dependencies