refactored to use Try.jar lib