refactored install.py create_cache and updated tests