Large test overhaul and removal of redundant code