fixed memory leak
moved all files to improve integration with different binaries