Moved init inside object factory