Refactored codebase of dockinstall/install.py

- Refactored codebase of dockinstall/install.py
- Fixed pep8 and flake8 warnings and errors