Improve file suffix handling; remove main.h