moved constructor and destructor to public