refactor memory leaks