Refactor out the three methods into separate scripts