Refactored testCore() to be simpler to manage and to have better code quality