cleanup of gpu code