encapsulate as require'able module