first attempt at JS encapsulation.