more partial function optimization