Removes repeated and/or uneeded code from tests