Re-engineered js patterns.
Removed unnecessary duplicated data.