Cleaning up main to use class methods