clean up and dependency resolving