move clear/swap to Main
no need for arrows here
cleanup Main
get rid of IO in the objects