Clean up and dividing into small files