Trying to clean up code and set up test better