Refactor last program into its own