Restructure and update tests