Refactoring, deleting unused files and older logic