fixed duplicate code and files