filesys refactor