refactoring last-access handling