move fs stuff into a separate module