Removed unused files, refractored it to be simpler.