Advanced JavaScript Class