Remove duplicate code for mark (un)read