Code cleanup, fix progress spinner