modular approach to maintainble javascript