Refactor into different files.