JavaScript UI implementation using MVC and creational design patterns