updated class to a more sexy way of creating classes in js