Code makeover in firmware: comments, added TODOs, some minor code additions and move-arounds