Total refactor to one file