Edited the code and reorganized with changesets

Edited the code and reorganized with changesets