Better function assignment