JS modified to revealing prototyping pattern