Move handlers to the correct location