Refactor system validation out to a separate function