use skip_prefix to avoid repeated calculations