code cleanup, added alternative download method