allow prefix to be a function