File reader code cleanup