added lookup class. refactored document.js