format code & clean up