Convert into an executable module
Modularize to prep for unit tests