make js more object oriented