added clean up method, addressed the code review changes