factor out eval
add module support for docs