Second version (Simple factory model)