Code cleanup - creating a class using prototype (incomplete)