rewrite accounts map function