optimize file handler performance