Use an extra function for body of try to follow clean code guidelines