Refactored Python install script