Example of using an OO aproach in JS