split FileHander functions to ease reuse