Split into multiple files, reorganized