Refactored some functions. Removed some unused files and merged to others. Changed directories and removed unused directories.