more cleanup of gpu code