modulize JavaScript Samples