Added dependencies for source installs and refactord similar parts into common include