Turning to a more object like javascript code style