refactoring assertion checks as private functions