Adds additional tests. Refactors some helper methods.