Refactor

Mode codefiles