Updated tests to decrease string repetition
Removed an unused variable
Some minor style changes
Merge pull request #1091 from mfeckie/refactor-tests

Refactor tests