Minor refactorings based on Weinan's insight

- Will eventually have to remove get_xattrs in the other pages -> In my TODO list