Refactored the tests and authorhelper