Starting to make client scripts more object oriented