Cleanup hardware queue

Some code cleanup.