Refactor test entry script