[Closes #47] Refactored testing logic