code optimization, filesystem try