Refactor OS package installation