added another script for the case of the Factory method in javascript