More work on accounts code