refactor fs operation.