refactor container classes to use check_type

to raise a ValueError intentionally