work in progress on refactoring via libjit