Delete test files and refactor code.