SMP cleanup and formattinhs. Needs more work for the HSM