You can add default value as fifth parameter and remove ternary operators everywhere