Cleanup of code for lynix/aerotools-ng#27 in preperation for promotion to master