Refactor main function, allow empty files
compile binary