Renamed struct to config (struct is reserved)
Minor code refactoring