Merge pull request #332 from shirou/test_refactoring

refactoring