refactored mac/linux conditionals