Fixed double references to PIA
Function library refactor out byte generation