Factor code into multiple files.