typing and little cleanup for fs