abstracted most of the functionality away from the main() module