Re-factor code to use validated python scripts