Moved instantiation of object into constructor