Made downloads configurable in yaml file. Some refactoring.