split file handler into seperate module