Reorganizing files and minor refactor