clean up main a bit