cleaned up multi way if formatting