refactored link output spec to include a helper method
changed link output spec added helper method and refactored