gensdrphy: clean up and implement data mask