partial function optimization