Reorganize folders and some improvements to the code.