clean up & format code