move config to struct, add nullable in port