Refactor test loader.