lib: add extract methods, cast doesn't validate
tests: refactor for previous