* Refactor assertion and adjust expected error message * Refactor assertion and adjust expected error message * Refactor assertion and remove redundant local variable * Refactor assertion and remove redundant local variable * Rename local variable * Apply formatting