removes unnecessary dependencies and puts others only where they are needed