Refactor test to main