Encapsulated map functions into js classes