Improved package dependencies

Took the ideas of issue #1 on board.