Move handlers out of main file.