refactoring to remove Try.get inside one Try context