format code + cleanup