Rearrange files structure and move some codes