format and fix some random code