Move assertion to the right method