adapt type and cast as dict