bits and pieces last firmware contribution for jake
small refactor to simplify repo before merge