Modified design patterns for js