clean up overlapped files and fixed build errors