rawpin: code cleanup