Refactor: Use `$#` to check parameters