Refactored to use a a script