using closure to hold referece to entity prototype