Firmware cleanup and code commenting