Moved heavy lifting (creating objects) from dispatcher to function.