Use lambdas instead of functools.partial
Strip and split on whitespace, not just spaces