Drop unused variables

This only drops a lot of unused variables. All other changes are split and moved to #224.