Separate the code away from the main script
Refactor tests